//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

//
// Board Level Definitions.
//
#ifndef __ELASTOS_P6032_H__
#define __ELASTOS_P6032_H__

/*
 * Interrupt sources.  The first 16 interrupt numbers are
 * allocated to ISA interrupts allowing standard interrupt
 * numbers to be used.
 */

#define P6032INT_ISA0    0
#define P6032INT_ISAKBD  1
#define P6032INT_CASCADE 2
#define P6032INT_ISACOM2 3
#define P6032INT_ISACOM1 4
#define P6032INT_ISA5    5
#define P6032INT_ISA6    6
#define P6032INT_ISA7    7
#define P6032INT_ISA8    8
#define P6032INT_ISA9    9
#define P6032INT_ISA10   10
#define P6032INT_ISA11   11
#define P6032INT_ISAPS2MOUSE 12
#define P6032INT_ISA13   13
#define P6032INT_ISAIDE0 14
#define P6032INT_ISAIDE1 15

#define P6032INT_MBOX0   16
#define P6032INT_MBOX1   17
#define P6032INT_MBOX2   18
#define P6032INT_MBOX3   19
#define P6032INT_DMARDY  20
#define P6032INT_DMAEMPTY 21
#define P6032INT_COPYRDY  22
#define P6032INT_COPYEMPTYRDY 23
#define P6032INT_COPYERR 24
#define P6032INT_PCIIRQ  25
#define P6032INT_MASTERERR 26
#define P6032INT_SYSTEMERR 27
#define P6032INT_DRAMPERR  28
#define P6032INT_MTIMEOUT  29

#ifdef CONFIG_ALGOR_P6032
#if 0
#define P6032INT_IRQA  35
#define P6032INT_IRQB  32
#define P6032INT_IRQC  33
#define P6032INT_IRQD  34
#else
#define P6032INT_IRQA  32
#define P6032INT_IRQB  33
#define P6032INT_IRQC  34
#define P6032INT_IRQD  35
#endif

#else /* GSMB */
#define P6032INT_IRQA           32
#define P6032INT_IRQB           33
#define P6032INT_IRQC           34
#define P6032INT_IRQD           35
#endif

#define P6032INT_ISANMI  41
#define P6032INT_ISAIRQ  42
#define P6032INT_ETH     43
#define P6032INT_ETH_ADD 44
//#define P6032INT_IDE   44
#define P6032INT_UART1   45
//#define P6032INT_UART0 46
#define P6032INT_AUDIO   46
/* Number of IRQ supported on hw interrupt 0. */
#define P6032INT_END       48

struct P6032IsrDescriptors
{
    isr_t   Isr;        // Interrupt service routine for IRQn
    void    *pDevice;   // Argument to pass to it
};

#define NR_IRQS 48  //bonito has 48 irqs in all of which the first 16
                    // ones are retained for ISA devices.

EXTERN void AddP6032Device(unsigned int uIrq, isr_t Isr, void *pDevice);
EXTERN void EnableP6032Irq(unsigned int irq_nr);
EXTERN void DisableP6032Irq(unsigned int irq_nr);
EXTERN void DoIrq(uint32_t uIrq, InterruptContext *pContext);

#endif // __ELASTOS_IT8172_H__
